<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:d="http://www.xidea.org/taglib/decorator" xml:lang="zh_CN"
  lang="zh_CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ANSII 处理相关</title>
<script src="../scripts/boot.js"></script>
<script>
function processAction(form,action){
    if(form.inputArea.value.replace(/^\s+/,'')){
        form.outputArea.value=action(form.inputArea.value,form.escapeASCII.checked);
    }else{
        $log.info("输入数据为空")
    }
}
$import('org.jside.webclick.unicode2native',true);
$import('org.jside.webclick.native2unicode',true);
$import('org.jside.webclick.entry2native',true);
$import('org.jside.webclick.native2entry',true);
$import('org.jside.webclick.asciiTableHTML',true);
$import('org.jside.webclick.MD5',true);
</script>
<style>
.ansii-table td{
  width:20px;height:20px;
}
#encode button{
    width:120px;
    text-align:center;
}
#encode textarea{
    width:400px;
    height:400px;
}
</style>
</head>
<body>
<div id="encode">
	<form onsubmit="return false">
	<table>
		<tr>
			<td><textarea id="inputArea""></textarea></td>
			<td>
				<div><button onclick="processAction(this.form,unicode2native)">\u6c49\u5b57<br/>→<br/>汉字</button></div>
				<div><button onclick="processAction(this.form,native2unicode)">汉字<br/>→<br/>\u6c49\u5b57</button></div>
				<div><button onclick="processAction(this.form,entry2native)">&amp;x6c49;&amp;x5b57;<br/>→<br/>汉字</button></div>
				<div><button onclick="processAction(this.form,native2entry)">汉字<br/>→<br/>&amp;x6c49;&amp;x5b57;</button></div>
				<div><button onclick="processAction(this.form,MD5)">求MD5值</button></div>
				<div style="padding-top:20px;text-align:right"><label>全部转换：<input type="checkbox" name="escapeASCII"/></label></div>
			</td>
			<td><textarea id="outputArea"></textarea></td>
		</tr>
	</table>
	</form>
</div>

<div class="ansii-table">
<script>document.write(asciiTableHTML)</script>
</div>
</body>
</html>